import { request } from "@/utils/axios"

/**
 * 老师登录
 */
export function TecLoginApi(data) {
    return request(
        {
            url: "/gradingTeacher/login",
            method: "POST",
            data: data
        }
    );
}

/**
 * 获取教师详情
 */
export function GradingTeacherApi(id) {
    return request(
        {
            url: `/gradingTeacher/info?gradingTeacherId=${id}`,
            method: "GET",
        }
    );
}

/**
 * 获取当前登录批卷老师的可批阅列表
 */
export function GradingTeacherPaperListApi(params) {
    return request(
        {
            url: `/gradingTeacher/paperList`,
            method: "GET",
            params: params
        }
    );
}

/**
 * 批阅选择题
 */
export function GradingTeacherReadOverSelectSubjectsApi(params) {
    return request(
        {
            url: `/gradingTeacher/readOverSelectSubjects`,
            method: "POST",
            params: params
        }
    );
}

/*
* 主观题列表
*/
export function GradingTeacherSubjectiveListApi(params) {
    return request(
        {
            url: `/gradingTeacher/subjectiveList`,
            method: "GET",
            params: params
        }
    );
}

/*
* 修改主观题成绩
*/
export function UpdateSubjectivityScore(data) {
    return request(
        {
            url: `/gradingTeacher/updateSubjectivityScore`,
            method: "POST",
            data: data
        }
    );
}

/**
 * 获取试题分页列表
 * subject/list?eventId=1
 */
export function GetSubjectList(params) {
    return request(
        {
            url: `/subject/list`,
            method: "GET",
            params: params
        }
    );
}

/**
 * 删除试题
 * subject/delete?subjectId=1
 */

export function DelSubject(params) {
    return request(
        {
            url: `/subject/delete`,
            method: "DELETE",
            params: params
        }
    );
}
export function DelSubjects(params) {
    return request(
        {
            url: `/subject/deleteAllSubject`,
            method: "DELETE",
            params: params
        }
    );
}
/**
 * 添加试题
 */
export function SubjectAdd(data, params = {}) {
    return request(
        {
            url: `/subject/add`,
            method: "POST",
            data,
            params
        }
    );
}

/**
 * 编辑试题
 */
export function SubjectUpdate(data) {
    return request(
        {
            url: `/subject/update`,
            method: "PUT",
            data
        }
    );
}

// 准考证---------------------------------------------
// examAttendance/list?eventId=2
/**
 * 获取准考证列表
 * /examAttendance/pageList 
 */
export function GetExamAttendancePageList(params) {
    return request(
        {
            url: `/examAttendance/pageList`,
            method: "GET",
            params: params
        }
    );
}
/**
 * 查询这个赛项下所有的准考证号 用来导出表格
 * subject/delete?subjectId=1
 */
export function GetExamAttendanceList(params) {
    return request(
        {
            url: `/examAttendance/list`,
            method: "GET",
            params: params
        }
    );
}
/**
 * 为一个赛项下的学生生成准考证
 */
export function GenerateExamAttendance(params) {
    return request(
        {
            url: `/examAttendance/generate`,
            method: "POST",
            params: params
        }
    );
}

/**
 * 清空准考成绩
 */

export function clearAllScore(params) {
    return request(
        {
            url: `/examAttendance/deleteAllScore`,
            method: "PUT",
            params: params
        }
    );
}
// 考场----------------------------------
/**
 * 获取考场列表
 */

export function GetSiteList(params) {
    return request(
        {
            url: `/site/list`,
            method: "GET",
            params: params
        }
    );
}
/**
 * 删除考场
 */

export function DeleteSite(params) {
    return request(
        {
            url: `/site/delete`,
            method: "DELETE",
            params: params
        }
    );
}

/**
 * 新增考场
 */

export function AddSite(data, params = {}) {
    return request(
        {
            url: `/site/add`,
            method: "POST",
            data: data,
            params
        }
    );
}

/**
 * 编辑考场
 */

export function UpdateSite(data) {
    return request(
        {
            url: `/site/update`,
            method: "PUT",
            data: data
        }
    );
}

// 批卷老师----------------
/**
 * 获取批卷老师
 */

export function GetGradingTeacherList(params) {
    return request(
        {
            url: `/gradingTeacher/list`,
            method: "GET",
            params: params
        }
    );
}

/**
 * 添加批卷老师
 */

export function AddGradingTeacher(params) {
    return request(
        {
            url: `/gradingTeacher/add`,
            method: "POST",
            params: params
        }
    );
}

/**
 * 更新批卷老师
 */

export function UpdateGradingTeacher(data) {
    return request(
        {
            url: `/gradingTeacher/update`,
            method: "PUT",
            data: data
        }
    );
}

/**
 * 删除批卷老师
 */

export function DelGradingTeacher(params) {
    return request(
        {
            url: `/gradingTeacher/delete`,
            method: "DELETE",
            params: params
        }
    );
}


/***
 * 准考详情
 */
export function getAdmissionTicket(params) {
    return request(
        {
            url: `/institution/getAdmissionTicket`,
            method: "GET",
            params: params
        }
    );
}
/**
 * http://127.0.0.1:8080/gradingTeacher/findStudentAnswerSituation?esId=3&currentPage=1&pageSize=10
 */
export function findStudentAnswerSituation(params) {
    return request({
        url: '/gradingTeacher/findStudentAnswerSituation',
        method: "GET",
        params
    })
}

/**
 * 获取赛项下学生列表 不分页
 * @param {*} params 
 * eventId studentName
 * @returns 
 */
export function getStudentNot(params = {}) {
    return request({
        url: '/examAttendance/getStudentNot',
        method: "GET",
        params
    })
}

/**
 * 获取赛项下考场列表 不分页
 * @param {*} params 
 * eventId
 * @returns 
 */
export function getEventRoom(params = {}) {
    return request({
        url: '/examAttendance/getSiteNot',
        method: "GET",
        params
    })
}


/**
 * 转移学生
 * @param {*} params 
 * eventId
 * @returns 
 */
export function transferStudents(data = {}) {
    return request({
        url: '/examAttendance/transferStudents',
        method: "POST",
        data
    })
}

/**
 * 获取赛项类型列表
 * @param {*} params 
 * eventId
 * @returns 
 */
export function eventTypePage(params) {
    return request({
        url: '/eventType/page',
        method: "GET",
        params
    })
}
/**
 * 新增比赛类型
 * @param {*} params 
 * eventId
 * @returns 
 */
export function eventTypeAdd(data) {
    return request({
        url: '/eventType/add',
        method: "POST",
        data
    })
}

/**
 * 修改比赛类型
 * @param {*} params 
 * eventId
 * @returns 
 */
export function eventTypeUpdate(data) {
    return request({
        url: '/eventType/update',
        method: "PUT",
        data
    })
}

/**
 * 删除比赛类型
 * @param {*} params 
 * eventId
 * @returns 
 */
export function eventTypeDelete(params) {
    return request({
        url: '/eventType/delete',
        method: "DELETE",
        params
    })
}

